package cn.lsoft.controller;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;

import javax.annotation.Resource;
import javax.servlet.ServletRequest;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import cn.lsoft.service.ApiService;
/**
 * @author <A HREF="mailto:undoner@gmail.com">undoner</A>
 * @date 19-05-2015
 */
@Controller
public class ApiController {
    
	private static final Logger LOGGER = Logger.getLogger(ApiController.class);
	private ApiService apiService;
    
	@RequestMapping(value = "getApi", method = RequestMethod.GET)
	@ResponseBody
	public String getApi(HttpServletRequest request, HttpServletResponse response) throws IOException {
		String para = request.getParameter("para");
		LOGGER.info(para);
		String jsonResult=apiService.getApi();
		jsonResult="{ok:{para:"+para+"}}";
		return jsonResult;
	}
}
